package com.linewell.license.demo.dao.impl;

import com.linewell.license.demo.dao.UserDao;
import com.linewell.license.demo.mapper.UserMapper;
import com.linewell.license.demo.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author
 * Company:
 * Createtime : 2019/10/22 11:11
 * Description :
 */
@Service
public class UserDaoImpl implements UserDao {

    @Autowired
    private UserMapper userMapper;

    @Override
    public User getUserByUserName(String userName) {
        User u = new User();
        u.setUserName(userName);
        User user = userMapper.findOne(u);
        if(user == null){
            return null;
        }
        return user;
    }
}
